
package org.amos.gen.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.amos.core.basic.utils.AmosUtils;
import org.amos.core.basic.utils.TreeUtils;
import org.amos.gen.entity.GenTemplateExplain;
import org.amos.gen.mapper.GenTemplateExplainMapper;
import org.amos.gen.service.GenTemplateExplainService;
import org.amos.gen.vo.GenExplainVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色表 服务实现类
 *
 * @author CodeGenerator
 * @since 2021-01-19
 */
@Service
public class GenTemplateExplainServiceImpl extends ServiceImpl<GenTemplateExplainMapper, GenTemplateExplain> implements GenTemplateExplainService {

    @Override
    public List<GenExplainVo> selectTree(QueryWrapper queryWrapper) {
        List<GenTemplateExplain> explains = baseMapper.selectList(queryWrapper);
        List<GenExplainVo> voList = AmosUtils.listCopy(explains, GenExplainVo.class);
        return TreeUtils.generateTrees(voList);
    }
}
